package com.property.management.schedule;

import com.property.management.mapper.CarportInfoMapper;
import com.property.management.service.IPayInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

@Configuration
@EnableScheduling
public class SystemSchedule {

    @Autowired
    private IPayInfoService payInfoService;
    @Autowired
    private CarportInfoMapper carportInfoMapper;

//    @Scheduled(cron = "0 0 1 * * ?")
    //测试用，1m一次
    @Scheduled(cron = "0 */1 * * * ?")
    private void expireInfos(){
        payInfoService.expirePayInfo();
        carportInfoMapper.expireCarportInfo();
    }


}
